package org.example.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class User implements Serializable {
    private static final long serialVersionUID = 1L; //完成序列化操作
    @TableId(type = IdType.AUTO,value = "user_id")
    private Integer user_id; //用户ID
    @TableField(value = "username")
    private String username; //用户名  唯一
    @TableField(value = "gender")
    private Integer gender; //性别(0-未知 1-男 2-女)
    @TableField(value = "userpwd")
    private String userpwd; //密码(加密存储)
    @TableField(value = "phone")
    private String phone; //手机号  唯一
    @TableField(value = "email")
    private String email; //邮箱   唯一
    @TableField(value = "head_url")
    private String head_url; //头像URL
    @TableField(value = "user_status")
    private Integer user_status; //状态(0-禁用 1-正常)

    @TableField(exist = false)
    private MultipartFile avatarImgFile;  //上传到oss的真是图片文件
    @TableField(exist = false)
    private String token;
}
